package com.itany.corejava.code08_集合.map集合;

import java.io.IOException;
import java.util.Properties;
import java.util.Set;

/**
 * @author MissChen
 * @date 2024年03月06日 9:55
 */
public class Test07_Properties {
    public static void main(String[] args) throws IOException {
        Properties properties = new Properties();
        properties.load(
                Test07_Properties.class.
                        getClassLoader()//获取当前类的类加载器，用于加载classpath路径下的资源
                        .getResourceAsStream("bean.properties")//指定需要加载的资源
        );

        Set<Object> keys=properties.keySet();
        for(Object key:keys){
            System.out.println(key);
            System.out.println(properties.getProperty((String)key));
        }

    }
}
